import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
//pojo实体类
//@WebServlet("/hello")//目前一个类只能请求一个地址，只能响应/hello
@WebServlet(urlPatterns = {"/hello"})//凡是请求hello地址的，只能请示这个helloServlet
//响应注解名称，在网页后加注解名称，就可以访问这个servlet
public class HelloServlet extends HttpServlet {
  //  alt+insert  选择第三个，然后选择第二个和第五个
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       System.out.println("进入后台");
    }
}
